package cn.edu.ctbu.lddweb.utils;

import cn.edu.ctbu.lddweb.constain.REnum;
import cn.edu.ctbu.lddweb.vo.R;

public class RUtil {
    public static R success(Object object) {
        R reslut=new R();
        reslut.setCode(1);
        reslut.setMsg("成功");
        reslut.setData(object);
        return reslut;
    }
    public static R success(){
        return success(null);
    }
    public static R error(Integer code,String msg){
        R reslut=new R();
        reslut.setCode(code);
        reslut.setMsg(msg);
        return reslut;
    }
    public static R error(REnum rEnum){
        R reslut=new R();
        reslut.setCode(reslut.getCode());
        reslut.setMsg(rEnum.getMsg());
        return reslut;
    }
}
